const path = require('path');

const files = require.context('@/assets/images/file', false, /\.png$/);

const dataPng = {};

files.keys().forEach((key) => {
  const fileName = path.basename(key);
  const fileExt = path.extname(key);
  Object.assign(dataPng, {
    [fileName.slice(0, fileName.lastIndexOf(fileExt))]: files(key),
  });
});

export default {
  data() {
    return {
      ...dataPng,
    };
  },
  methods: {
    uploadIcon(icon) { return this[icon]; },
  },
};
